package cn.itcast.bos.dao;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import cn.itcast.bos.domain.base.Standard;
@Repository
public interface StandardRepository extends JpaRepository<Standard, Integer> {
	public List<Standard> findByName(String name);
	public List<Standard>findByNameLike(String name);
	
	@Query(value="select * from t_standard where c_name = ?",nativeQuery=true)
	public List<Standard>queryName(String name);
	
	@Query(value="from Standard where name = ?",nativeQuery=false)
	public List<Standard>queryName2(String name);
	
	@Query()
	public List<Standard>queryByName(String name);
	
	@Query(value="update Standard set minLength = ?2 where id = ?1")
	@Modifying
	public void updataSandard(Integer id,Integer minLength);
	
}
